Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX(client): Fix PulseAudio regression by nulling buffer #6316

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

Hartmnt
Copy link
Member

@Hartmnt Hartmnt commented Jan 24, 2024

In b5a67c0 a buffer in the PulseAudio backend was made static, but at the same time the memset(0) was removed.
In combination, that lead to a bug where the last few frames of any given audio played back was repeated until something else filled the buffer.

This commit adds a simple fill to the buffer where the memset(0) previously was fixing the bug.

Exact bug location: b5a67c0#diff-3468a698a1554e9292714294b8c8766bff543c8b4949c3fa02ad833084bf2867L648-R665

@Hartmnt Hartmnt added client linux audio bug A bug (error) in the software labels Jan 24, 2024
In b5a67c0 a buffer in the PulseAudio backend was made static, but
at the same time the memset(0) was removed.
In combination, that lead to a bug where the last few frames
of any given audio played back was repeated until something
else filled the buffer.

This commit adds a simple fill to the buffer where the memset(0)
previously was fixing the bug.
Copy link
Member

@Krzmbrzl Krzmbrzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite see why this caused a loop but this fix looks good even without considering looping :)

@davidebeatrici
Copy link
Member

The loop was caused by the same audio samples being reproduced continuously.

@Krzmbrzl
Copy link
Member

Yeah, that much is clear :P
The question is where is the causality between not zeroing out the buffer and samples replaying?

@Hartmnt Hartmnt merged commit 6a48c04 into mumble-voip:master Jan 24, 2024
13 checks passed
@davidebeatrici
Copy link
Member

The content of the buffer is unchanged if we don't have any audio samples to reproduce, meaning that the same data is reproduced every time the function is called (i.e. for every period, which depends on the buffer size).

@Krzmbrzl
Copy link
Member

Ah, so the callback is called indefinitely and not only when we actually have audio? Okay that makes sense, thanks!

@davidebeatrici
Copy link
Member

Yeah, it's libpulse that calls it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio bug A bug (error) in the software client linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants